package com.ruoyi.active.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.active.mapper.TbProdAttaMapper;
import com.ruoyi.active.domain.TbProdAtta;
import com.ruoyi.active.service.ITbProdAttaService;

/**
 * 商品附件Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-01
 */
@Service
public class TbProdAttaServiceImpl implements ITbProdAttaService 
{
    @Autowired
    private TbProdAttaMapper tbProdAttaMapper;

    /**
     * 查询商品附件
     * 
     * @param attaId 商品附件主键
     * @return 商品附件
     */
    @Override
    public TbProdAtta selectTbProdAttaByAttaId(Long attaId)
    {
        return tbProdAttaMapper.selectTbProdAttaByAttaId(attaId);
    }

    /**
     * 查询商品附件列表
     * 
     * @param tbProdAtta 商品附件
     * @return 商品附件
     */
    @Override
    public List<TbProdAtta> selectTbProdAttaList(TbProdAtta tbProdAtta)
    {
        return tbProdAttaMapper.selectTbProdAttaList(tbProdAtta);
    }

    /**
     * 新增商品附件
     * 
     * @param tbProdAtta 商品附件
     * @return 结果
     */
    @Override
    public int insertTbProdAtta(TbProdAtta tbProdAtta)
    {
        tbProdAtta.setCreateTime(DateUtils.getNowDate());
        return tbProdAttaMapper.insertTbProdAtta(tbProdAtta);
    }

    /**
     * 修改商品附件
     * 
     * @param tbProdAtta 商品附件
     * @return 结果
     */
    @Override
    public int updateTbProdAtta(TbProdAtta tbProdAtta)
    {
        tbProdAtta.setUpdateTime(DateUtils.getNowDate());
        return tbProdAttaMapper.updateTbProdAtta(tbProdAtta);
    }

    /**
     * 批量删除商品附件
     * 
     * @param attaIds 需要删除的商品附件主键
     * @return 结果
     */
    @Override
    public int deleteTbProdAttaByAttaIds(Long[] attaIds)
    {
        return tbProdAttaMapper.deleteTbProdAttaByAttaIds(attaIds);
    }

    /**
     * 删除商品附件信息
     * 
     * @param attaId 商品附件主键
     * @return 结果
     */
    @Override
    public int deleteTbProdAttaByAttaId(Long attaId)
    {
        return tbProdAttaMapper.deleteTbProdAttaByAttaId(attaId);
    }
}
